import {
	createRouter,
	createWebHashHistory
} from 'vue-router'
import VueCookies from 'vue-cookies'

const routes = [{
		// 匹配所有路径  vue2使用*   vue3使用/:pathMatch(.*)*或/:pathMatch(.*)或/:catchAll(.*)
		path: "/:pathMatch(.*)*",
		name: "home",
		component: () => import('../views/Home.vue')
	},
	{
		path: '/login',
		component: () => import('../views/Login.vue')
	},
	{
		path: '/home',
		component: () => import('../views/Home.vue'),
		children: [{
				path: 'usedcar',
				component: () => import('../views/page/UsedcarManage.vue')
			},
			{
				path: 'seller',
				component: () => import('../views/page/SellerManage.vue')
			},
			{
				path: 'user',
				component: () => import('../views/page/UserManage.vue')
			},
			{
				path: 'platform/carousel',
				component: () => import('../views/page/platform/Carousel.vue')
			},
			{
				path: 'platform/recommend',
				component: () => import('../views/page/platform/Recommend.vue')
			},
			{
				path: 'log/seller',
				component: () => import('../views/page/log/SellerLog.vue')
			},
			{
				path: 'log/user',
				component: () => import('../views/page/log/UserLog.vue')
			}
		]
	}
]

const router = createRouter({
	history: createWebHashHistory(),
	routes
})

export default router
